import { createApp } from 'vue'
import { createPinia } from 'pinia'
import router from './router'
import App from './App.vue'
import { 
  Button, 
  Cell, 
  CellGroup,
  Field,
  Form,
  Icon, 
  NavBar, 
  Tabbar, 
  TabbarItem,
  Grid,
  GridItem,
  Search,
  Tag,
  Dialog,
  Toast,
  Loading,
  Uploader
} from 'vant'
import 'vant/lib/index.css'
import './assets/styles/main.scss'

const app = createApp(App)

// 注册Vant组件
const vantComponents = [
  Button, 
  Cell, 
  CellGroup,
  Field,
  Form,
  Icon, 
  NavBar, 
  Tabbar, 
  TabbarItem,
  Grid,
  GridItem,
  Search,
  Tag,
  Dialog,
  Toast,
  Loading,
  Uploader
]
vantComponents.forEach(component => app.use(component))

app.use(createPinia())
app.use(router)

app.mount('#app')
